// 蓝湖地址   https://lanhuapp.com/url/2r5wj-mBQpe

// git地址   http://122.114.251.179:9091/cl051/YiFuData.git     密码   cl112358

// gitLab地址      http://122.114.251.179:9091/profile    账号 1012726236@qq.com   jinzhixin99bj



// 充电宝地址：      http://192.168.3.15:8981/swagger-ui.html#/APP%E5%95%86%E6%88%B7%E7%AE%A1%E7%90%86/findShopStatisticsUsingPOST_1

// // const HOST = 'http://cdb.lianmengxiton.cn/'






// 引入工具类
import request from '@/utils/uniRequest' 
 

export function loginCDB(data:any){ //登录
console.log('123666',JSON.stringify(data))
	return request({
	    url: 'app/login',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function registerCDB(data:any){ //注册
console.log('123666',JSON.stringify(data))
	return request({
	    url: '/app/register',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function sendMsgCDB(data:any){    //发送验证码
console.log('123666',JSON.stringify(data))
	return request({
	    url: 'app/sendMsg',
		method: 'get',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function forGotpwd(data:any){ //忘记密码

	return request({
	    url: '/app/retrievePassword',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function updatePwd(data:any){ ///app/user/updatePwd   修改密码

	return request({
	    url: '/app/user/updatePwd',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function totaleChart(data:any){ //总数据

	return request({
	    url: 'app/statistics/graphStatistics',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}




export function calendarStatic(data:any){    //商户统计详情

	return request({
	    url: '/app/statistics/shopStatisticsDetails',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findPosType(data:any){    //当前登录人所拥有的设备机型分组

	return request({
	    url: '/app/terminal/findPosType',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findTerminalByType(data:any){    ///设备列表 通过传入的机型id  铺货

	return request({
	    url: 'app/terminal/findTerminalByType',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findTerminalDetails(data:any){    //  /app/terminal/findTerminalDetails 设备详情

	return request({
	    url: '/app/terminal/findTerminalDetails',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}




export function findLowerPosTypeBox(data:any){    // 下级代理设备统计查询 头部

	return request({
	    url: '/app/terminal/findLowerPosTypeBox',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findLowerProxyPosTypeCount(data:any){    // 下级代理设备统计查询

	return request({
	    url: '/app/terminal/findLowerProxyPosTypeCount',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findLostOnlineTerminal(data:any){    // 掉线设备

	return request({
	    url: '/app/terminal/findLostOnlineTerminal',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function popupTerminal(data:any){    // 弹出充电宝(槽位没有检测到充电宝就不弹出)

	return request({
	    url: '/app/terminal/popupTerminal',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findMaintainOrderList(data:any){    ///		代理-维修单列表

	return request({
	    url: 'app/shop/findMaintainOrderList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}
export function maintainOrderFinish(data:any){    ///	代理-维修单完成维修

	return request({
	    url: '/app/shop/maintainOrderFinish',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findWhiteListMemberList(data:any){    ///	查询白名单成员列表

	return request({
	    url: '/app/whiteList/findWhiteListMemberList',
		method: 'get',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}
export function earningsStatistics(data:any){    //  /app/statistics/earningsStatistics 收益

	return request({
	    url: '/app/statistics/earningsStatistics',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

//       2020-11-09    baojun start


export function userOrderListRenting(data:any){    // User订单列表查询

	return request({
	    url: '/app/powerBankOrder/findPowerBankOrder',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function subsetProxyOrderList(data:any){    // 下级代理订单统计

	return request({
	    url: '/app/powerBankOrder/subsetProxyOrderList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findShopStatistics(data:any){    // 查询商户统计

	return request({
	    url: '/app/shop/findShopStatistics',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findShopDetails(data:any){    // 查询代理下的商户详情

	return request({
	    url: '/app/shop/findShopDetails',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findTerminalByShop(data:any){    // 商户下的设备列表

	return request({
	    url: '/app/terminal/findTerminalByShop',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function getOrderEnumBox(data:any){    ///	结束充电宝订单类型下拉

	return request({
	    url: '/app/powerBankOrder/getOrderEnumBox',
		method: 'get',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function endOrder(data:any){    // 手动结束订单

	return request({
	    url: `/app/powerBankOrder/endOrder?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function orderDetails(data:any){    // 充电宝订单详情

	return request({
	    url: '/app/powerBankOrder/orderDetails',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}



export function findShopBox(data:any){    //  /app/shop/findShopBox  商户下拉选择框

	return request({
	    url: '/app/shop/findShopBox',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findTerminalBox(data:any){    //  /app/shop/findShopBox  查询商户下的 设备下拉框

	return request({
	    url: '/app/terminal/findTerminalBox',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findProxyList(data:any){    //  查询代理列表

	return request({
	    url: '/app/user/findProxyList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findPosBrand(data:any){    // 查询O单下的品牌

	return request({
	    url: '/app/goods/findPosBrand',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findPosTypeForGoods(data:any){    // 查询品牌下的设备和价格

	return request({
	    url: '/app/goods/findPosType',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function forcePopupTerminal(data:any){    // 强制弹出充电宝(槽位没有检测到充电宝也继续弹出)

	return request({
	    url: '/app/terminal/forcePopupTerminal',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function terminalRelieve(data:any){    // 设备解除绑定

	return request({
	    url: '/app/terminal/terminalRelieve',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function addCartGoods(data:any){    //添加商品到购物车

	return request({
	    url: '/app/goodsCart/addCartGoods',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function delCartGoods(data:any){    //删除购物车商品

	return request({
	    url: '/app/goodsCart/delCartGoods',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function editCartGoodsNum(data:any){    //修改购物车商品数量

	return request({
	    url: '/app/goodsCart/editCartGoodsNum',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findCartGoods(data:any){    //查询购物车商品

	return request({
	    url: '/app/goodsCart/findCartGoods',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findAddress(data:any){    //查询地址列表

	return request({
	    url: '/app/address/findAddress',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function saveAddress(data:any){    //新增、编辑、删除地址

	return request({
	    url: `/app/address/saveAddress?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function setDefaultAddress(data:any){    //设置默认地址

	return request({
	    url: '/app/address/setDefaultAddress',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function freightCalculate(data:any){    //计算邮费

	return request({
	    url: '/app/posOrder/freightCalculate',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findAddressBox(data:any){    //地址选择下拉框

	return request({
	    url: '/app/addressCodeDict/findAddressBox',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function saveOrderByBalance(data:any){    //创建购买设备订单并余额支付

	return request({
	    url: '/app/posOrder/saveOrderByBalance',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function saveOrder(data:any){    //创建购买设备订单

	return request({
	    url: '/app/posOrder/saveOrder',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function aliPay(data:any){    //订单支付宝支付(设备购买、会员购买通用)

	return request({
	    url: '/app/posOrder/aliPay',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function orderList(data:any){    //个人中心     我的订单

	return request({
	    url: '/app/posOrder/orderList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function cancelOrder(data:any){    //个人中心     取消付款

	return request({
	    url: '/app/posOrder/cancelOrder',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function orderConfirmReceipt(data:any){    //个人中心     订单  确认收货

	return request({
	    url: '/app/posOrder/orderConfirmReceipt',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

//       2020-11-09    baojun end   25    

export function shopTerminalProfit(data:any){    // /app/statistics/shopTerminalProfit  商户设备收益列表

	return request({
	    url: '/app/statistics/shopTerminalProfit',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}



export function shopTerminalProfitSH(data:any){    //  /app/statistics/earningsStatistics 商户设备收益列表(时间不传默认查询当天)

	return request({
	    url: '/app/statistics/shopTerminalProfit',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function transactionStatistics(data:any){    //  统计----交易统计

	return request({
	    url: '/app/statistics/transactionStatistics',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


    

export function findProfitRuleList(data:any){    //  统计--交易--头部 分润规则列表

	return request({
	    url: '/app/profitRule/findProfitRuleList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function userTransaction(data:any){    //  统计--交易-收益列表

	return request({
	    url: '/app/statistics/userTransaction',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findTerminalBySn(data:any){    //  /app/terminal/findTerminalBySn	设备归属查询	SN查询

	return request({
	    url: '/app/terminal/findTerminalBySn',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any

}



export function shopStatistics(data:any){    //  	商户-统计上面数据

	return request({
	    url: '/app/statistics/shopStatistics',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function shopList(data:any){    //  		商户-商户列表

	return request({
	    url: '/app/statistics/shopList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findShopList(data:any){    //  					查询代理下的商户列表

	return request({
	    url: '/app/shop/findShopList',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findShopBranch(data:any){     //查询商户网点列表

	return request({
	    url: '/app/shopBranch/findShopBranch',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function distributionApi(data:any){     // 批量铺货

	return request({
	    url: '/app/terminal/distribution',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findShopBranchBox(data:any){     //查询商户网点下拉框

	return request({
	    url: '/app/shopBranch/findShopBranchBox',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findBranchSite(data?:any){     // /app/shopBranch/findBranchSite	获取网点类型
	return request({
	    url: '/app/shopBranch/findBranchSite',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function saveShopBranch(data:any){     // /app/shopBranch/saveShopBranch		保存商户网点(新增、编辑、删除)

		console.log(data,'datarequext')

	return request({
		
		
	    url: `/app/shopBranch/saveShopBranch?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function saveShopInfo(data:any){   //   /app/shop/saveShopInfo	商户信息保存11111
	return request({
	    url: `/app/shop/saveShopInfo?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function saveShopAndBranchInfo(data:any){
	return request({
	    url: `/app/shop/saveShopAndBranchInfo?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function distribution(data:any){   //  	 // 			批量铺货
	return request({
	    url: `/app/terminal/distribution`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function findUserInfo(data:any){   //  	/app/user/findUserInfo	个人中心
	return request({
	    url: `/app/user/findUserInfo`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findHomeRollNewsList(data:any){   //  	/app/news/findHomeRollNewsList		首页滚动消息
	return request({
	    url: `/app/news/findHomeRollNewsList`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findNewsList(data:any){   //  	/app/news/findNewsList		消息列表查询
	return request({
	    url: `/app/news/findNewsList`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function myEarnings(data:any){   //  	/app/statistics/myEarnings			首页-我的收益（代理、商户通用）
	return request({
	    url: `/app/statistics/myEarnings`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function uploadApi(data:any){   //  上传图片
	return request({
	    url: `http://cdb.lianmengxiton.cn/app/upload`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function saveUserInfo(data:any){   // /app/user/saveUserInfo   设置代理信息(头像，昵称)
	return request({
	    url: `/app/user/saveUserInfo `,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function myStaff(data:any){   //  	/app/user/myStaff  我的员工
	return request({
	    url: `/app/user/myStaff`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}
export function addStaff(data:any){   //  	/app/user/addStaff					新增员工(员工登录无该操作)
	return request({
	    url: `/app/user/addStaff?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function editStaff(data:any){   //  /app/user/editStaff					编辑员工(员工登录无该操作)
	return request({
	    url: `/app/user/editStaff?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	 }) as any
}

export function delStaff(data:any){   //   /app/user/delStaff					删除员工(员工登录无该操作)
	return request({
	    url: `/app/user/delStaff`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function bindingZfb(data:any){   //  /app/user/bindingZfb   支付宝绑定
	return request({
	    url: `/app/user/bindingZfb`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function bindingIdentity(data:any){   //  /app/user/bindingIdentity   代理身份证绑定
	return request({
	    url: `/app/user/bindingIdentity`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}
export function drawMoney(data:any){   // /app/drawMoney/drawMoney   提现
	return request({
	    url: `/app/drawMoney/drawMoney`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findProxyDrawMoneyList(data:any){   // /app/drawMoney/findProxyDrawMoneyList   代理提现记录

	return request({
	    url: `/app/drawMoney/findProxyDrawMoneyList`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findProxyDrawMoneySum(data:any){   // /app/drawMoney/findProxyDrawMoneySum   提现合计

	return request({
	    url: `/app/drawMoney/findProxyDrawMoneySum`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


export function porxyNewShopRank(data:any){   // /app/statistics/porxyNewShopRank   商户-代理新增商户排行榜


	return request({
	    url: `/app/statistics/porxyNewShopRank`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function bankBill(data:any){   // /app/statistics/bankBill   宝买卖收支明细


	return request({
	    url: `/app/statistics/bankBill`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function bankProfit(data:any){   // /app/statistics/bankProfit  宝买卖收益

	return request({
	    url: `/app/statistics/bankProfit`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function profitDetails(data:any){  // /app/statistics/profitDetails		分润明细-列表(代理、商户通用)

	return request({
	    url: `/app/statistics/profitDetails`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function profitDetailsSum(data:any){  // /app/statistics/profitDetailsSum	分润明细-合计

	return request({
	    url: `/app/statistics/profitDetailsSum`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

// /app/statistics/profitDetails		分润明细-列表(代理、商户通用)
// 请求参数:
// userId		代理ID 或 商户ID
// dateTime	查询时间（格式：2020-10-1 或 2020-10）
// dateType	(month 按月查询,day 按天查询)
// userType	("0" user ,"1" shop)
// pageNo
// pageSize
// 返回参数：

// createTime  收益时间
// money		收益金额

// ---------------------------------------------------------------------------------

// /app/statistics/profitDetailsSum	分润明细-合计
// 请求参数:
// userId		代理ID 或 商户ID
// dateTime	查询时间（格式：2020-10-1 或 2020-10）
// dateType	(month 按月查询,day 按天查询)
// userType	("0" user ,"1" shop)
// 返回参数：



// export function terminalRelieve(data:any){   //  /app/terminal/terminalRelieve  设备解除绑定


// 	return request({
// 	    url: `/app/terminal/terminalRelieve`,
// 		method: 'post',
// 		contentType:'application/x-www-form-urlencoded',
// 		data: data
// 	 }) as any
// }






export function findRoleList(data:any){   // /app/role/findRoleList  查询可购买的会员


	return request({
	    url: `/app/role/findRoleList`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function findUserMoney(data:any){  // /app/drawMoney/findUserMoney  查询用户余额和冻结金额


	return request({
	    url: `/app/drawMoney/findUserMoney`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function callBack(data:any){  // /app/role/callBack  会员购买回调接口


	return request({
	    url: `/app/role/callBack`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

export function saveRoleOrder(data:any){  // /app/role/saveRoleOrder  保存会员购买订单(支付宝支付)

	return request({
	    url: `/app/role/saveRoleOrder`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}

// /app/role/saveRoleOrderByH5 保存会员购买订单(支付宝支付)

export function saveRoleOrderByH5(data:any){  // /app/role/saveRoleOrder  保存会员购买订单(支付宝支付)
	return request({
	    url: `/app/role/saveRoleOrderByH5`,
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}


// 请求参数:
// userId shopId 或 userId
// type ID类型（0 代理 ,1 商户,）
// 返回参数：
// blance   余额
// freezeMoney  冻结金额
// usableBlance    可用余额



// ///  zhifu
// export function aliPay(data:any){  // /app/posOrder/aliPay


//  return request({
//      url: `/app/posOrder/aliPay`,
//   method: 'get',
//   contentType:'application/x-www-form-urlencoded',
//   data: data
//   }) as any
// }


// export function saveOrderByBalance(data:any){  //  /app/posOrder/saveOrderByBalance   创建购买设备订单并余额支付
//  return request({
//      url: `/app/posOrder/saveOrderByBalance`,
//   method: 'post',
//   contentType:'application/x-www-form-urlencoded',
//   data: data
//   }) as any
// }


export function orderDetailsByOrderNo(data:any){  //  /app/posOrder/orderDetailsByOrderNo  订单详情
 return request({
     url: `/app/posOrder/orderDetailsByOrderNo`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function findShareRole(data:any){  //   /app/shareDict/findShareDict   查询是否拥有分享权限
 return request({
     url: `/app/terminal/findShareRole`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function  payRoleByBalance(data:any){  // 会员升级 余额支付

 return request({
     url: `app/role/payRoleByBalance`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any

}


export function findShareDict(data:any){  //   /app/shareDict/findShareDict   查询分享列表
 return request({
     url: `/app/shareDict/findShareDict`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function getTypeBox(data:any){  //  /app/shareDict/getTypeBox    查询类型分组
 return request({
     url: `/app/shareDict/getTypeBox`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function findUserBox(data:any){  // 查询调拨对象 O单下的代理列表
 return request({
     url: `/app/user/findUserBox`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function terminalAllot(data:any){  // 设备调拨
 return request({
     url: `/app/terminal/terminalAllot`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function findCommonProblem(data:any){  //       查询常见问题列表
 return request({
     url: `/app/oBrandConfig/findCommonProblem`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

//设备调拨记录
export function terminalAllotLog(data:any) { 
	return request({
		url:'/app/terminal/terminalAllotLog',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	}) as any
}


export function findTimeQuantum(data:any) { //获取充电线可租借时间段
	return request({
		url:'/app/terminal/findTimeQuantum',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	}) as any
}
export function savePowerWire(data:any) { //获取充电线可租借时间段
	return request({
		url:'/app/terminal/savePowerWire',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	}) as any
}



export function saveWhiteList(data:any) { //新增白名单
	return request({
		url: `/app/whiteList/saveWhiteList?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	}) as any
}

export function delWhiteList(data:any) { //批量删除白名单
	return request({
		url:  '/app/whiteList/delWhiteListMember',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	}) as any
}

export function updateWhiteList(data:any) { //编辑白名单
	return request({
		url: `/app/whiteList/updateWhiteList?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
		method: 'post',
		contentType:'application/json',
		data: data
	}) as any
}


//  获取白名单二维码
export function getWhiteListUrl(data:any){  //  获取白名单二维码
 return request({
     url: `/app/whiteList/getWhiteListUrl`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
//查询商户下的白名单列表
export function findShopWhiteList(data:any) { 
	return request({
	url: `/app/whiteList/findShopWhiteList`,
	method: 'post',
	contentType:'application/x-www-form-urlencoded',
	data: data
	}) as any
}

//  虚拟码相关api
export function deviceVirtualList(data:any){  //  获取虚拟码列表
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/list`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function bindStore(data:any,sn:any){  //  虚拟码 绑定商户
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/bindStore/`+sn,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
export function deviceVirtualDetail(data:any,sn:any){  //  虚拟码  获取虚拟码详情
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/detail/`+sn,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
export function virtualDeviceList(data:any){  //  虚拟码  获取虚拟码设备列表
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/virtualDeviceList`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
export function bindDevice(data:any,sn:any){  //  虚拟码 绑定设备
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/bindDevice/`+sn,
  method: 'POST',
  contentType:'application/json',
  data: data
  }) as any
}
export function updatePrice(data:any,sn:any){  //  虚拟码 虚拟码编辑计费信息
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/updatePrice/`+sn,
  method: 'POST',
  contentType:'application/json',
  data: data
  }) as any
}
export function createQrCode(data:any,sn:any){  //  虚拟码 生成设备虚拟码链接(二维码)
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/createQrCode/`+sn,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
export function resetVirtual(data:any,sn:any){  //  虚拟码 重置虚拟码（未使用）
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/deviceVirtual/resetVirtual/`+sn,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}
export function virtualTerminalRelieve(data:any){  // 虚拟码 重置虚拟码   新接口
 return request({
     url: `/app/terminal/virtualTerminalRelieve`,
  method: 'post',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function feedbackFind(data:any){  //  设备报修 获取问题跟进列表
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/feedback/find`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function feedbackSave(data:any){  //  设备报修 添加
 return request({
     url: `https://e.yhhuoxing.com/apis/agent/feedback/save`,
  method: 'POST',
  contentType:'application/json',
  data: data
  }) as any
}

export function imageUploadApi(data:any){  //  设备报修 上传图片
 return request({
     url: `https://e.yhhuoxing.com/apis/common/upload/image/complete`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function UploadApi(data:any){  //  base64 上传图片
 return request({
     url: `/app/upload64`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function carQuantity(data:any){  //  查询购物车商品数量
 return request({
     url: `/app/goodsCart/findGoodsCartNum`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function agentStatistics(data:any){  //  代理统计首页
 return request({
     url: `/app/statistics/agentStatistics`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function agentStatisticsOwn(data:any){  //  代理统计-代理激活统计
 return request({
     url: `/app/statistics/agentStatisticsOwn`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function agentStatisticsTerminal(data:any){  //  代理统计-激活设备统计
 return request({
     url: `/app/statistics/agentStatisticsTerminal`,
  method: 'POST',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}

export function updateTerminalCostConfig(data:any){  //  编辑底座计费信息
 return request({
     url: `/app/terminal/updateTerminalCostConfig?userId=${uni.getStorageSync("userId") == ""? "" : parseInt(uni.getStorageSync("userId"))}`,
  method: 'POST',
  contentType:'application/json',
  data: data
  }) as any
}

export function getShareImg(data:any){  //  分享图片
 return request({
     url: `app/getShareImg`,
  method: 'get',
  contentType:'application/x-www-form-urlencoded',
  data: data
  }) as any
}












//2020-11-03

export function loginAPPs(data:any){          // 模拟登录
console.log('123666',JSON.stringify(data))
	return request({
	    url: 'http://cdb.lianmengxiton.cn/app/login',
		method: 'post',
		contentType:'application/x-www-form-urlencoded',
		data: data
	 }) as any
}